part of simple_state_driver;

class ColorState extends StorableState<Color> {
  ColorState(
      {required Color initValue, required super.storeKey, super.autoSave})
      : super(initValue: initValue);

  @override
  void getFromDataStorer() {
    final val = dataStorer?.get<int>(storeKey);
    value = val != null ? Color(val) : value;
  }

  @override
  Future<void> putToDataStorer() async {
    dataStorer?.put(storeKey, value.toARGB32());
  }
}